<template>
  <div>
    <textareaItem @changeText="changeText" :formItem="compConfig" :formNamePath="props.formNamePath"
      @getSummary="getSummary"></textareaItem>
  </div>
</template>

<script lang="ts" setup>
import { ref, computed } from "vue"
import textareaItem from "../../formitem/textarea/index.vue"
import formItemForm from './config';
import { useModelStore } from '@/store/modules/model/column'
import { useColumnModel } from '@/components/draggable/hooks/useColumnModel';
const useModel = useModelStore()
const props = defineProps({
  element: [],
  formNamePath: []
})
const emit = defineEmits(['getSummary'])
const compConfig = ref(JSON.parse(JSON.stringify(formItemForm.component.settings)));
useColumnModel(compConfig, computed(() => props.element));
const changeText = (value: string) => {
  useModel.setData({ param: formItemForm.component.settings.param, value })
}

const getSummary = (val: any) => {
  emit('getSummary', val);
}
</script>

<style lang="less" scoped></style>